using System;
using System.Collections.Generic;
using System.IO;

public class FileScanner
{
    private List<string> _ignorePatterns;

    public FileScanner(string ignoreFilePath)
    {
        _ignorePatterns = new List<string>();
        if (File.Exists(ignoreFilePath))
        {
            _ignorePatterns.AddRange(File.ReadAllLines(ignoreFilePath));
        }
    }

    public IEnumerable<string> GetFiles(string directory, string[] extensions)
    {
        var files = new List<string>();
        foreach (var file in Directory.GetFiles(directory, "*.*", SearchOption.AllDirectories))
        {
            if (ShouldIgnore(file)) continue;
            if (extensions == null || extensions.Length == 0 || Array.Exists(extensions, ext => file.EndsWith(ext)))
            {
                files.Add(file);
            }
        }
        return files;
    }

    private bool ShouldIgnore(string filePath)
    {
        foreach (var pattern in _ignorePatterns)
        {
            if (filePath.Contains(pattern)) return true;
        }
        return false;
    }
} 